home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / comms / internet / web-related / apache_1.0.5 / install_apache < prev    next >
Text File  |  1996-06-25  |  5KB  |  225 lines

  1. ;;
  2. ;; Installation script for Apache
  3. ;;
  4.  
  5. ;; Set Inet: To AMiTCP: if it doesn't exist
  6. (if (= (exists "Inet:db/passwd" (noreq)) 0)
  7.     (makeassign "Inet" "AmiTCP:" (safe))
  8.     (debug "inet: exists")
  9. )
  10.  
  11.  
  12. (if
  13. (and
  14.     (= (exists "libs:ixemul.library") 1)
  15.     ( < ( / (getversion "libs:ixemul.library") 65536) 43 ) )
  16.     (abort "You must have ixemul.library version >43.0 to run Apache.")
  17. )
  18.  
  19. (set @source-dir
  20.     (if (= 1 (exists @icon) )
  21.     (pathonly (expandpath @icon))
  22.     (expandpath @icon)
  23.     )
  24. )
  25.  
  26. (select
  27.     (askchoice
  28.     (prompt "Which version of apache do you want to install")
  29.     (choices "000" "020+")
  30.     (help "For people who have a 68020+ CPU, choose 020+, else choose 000")
  31.     )
  32.     (set @apache-ver "httpd000")
  33.     (set @apache-ver "httpd020")
  34. )
  35.  
  36. (set @apache-dest
  37.     (askdir
  38.     (prompt "Enter directory for installing apache. The script will create a directory called apache_1.0.5. If the current directory is chosen, it will install in place")
  39.     (help @askdir-help)
  40.     (default @source-dir)
  41.     )
  42. )
  43.  
  44. (if (= @apache-dest @source-dir)
  45.     (set @apache-src-dest @apache-dest)
  46.     (set @apache-src-dest (tackon @apache-dest "apache_1.0.5") )
  47. )
  48. (debug "apache-src-dest is " @apache-src-dest)
  49. (makeassign "apache" @apache-src-dest)
  50.  
  51. (set apache-install "")
  52.  
  53. (set @source-bin-dir (tackon @apache-src-dest "bin") )
  54.  
  55. (debug "source-dir is " @source-dir)
  56. (debug "source-bin-dir is " @source-bin-dir)
  57.  
  58.  
  59. ;only copy files if installing into another dir
  60. (if (= @source-dir @apache-dest)
  61.     (debug "installing into same directory")
  62.     (
  63.     (makedir @apache-src-dest)
  64.     (copyfiles
  65.         (prompt "Copying necessary files")
  66.         (source @source-dir)
  67.         (dest @apache-src-dest)
  68.         (help @copyfiles-help)
  69.         (all)
  70.         (infos)
  71.     )
  72.     )
  73. )
  74.  
  75. ; copy httpdxxx to httpd
  76. (copyfiles
  77.     (prompt "copying the necessary httpd cpu version")
  78.     (source (tackon @apache-src-dest @apache-ver) )
  79.     (dest   @apache-src-dest)
  80.     (newname "httpd")
  81. )
  82.  
  83. (delete (tackon @apache-src-dest "httpd000") )
  84. (delete (tackon @apache-src-dest "httpd020") )
  85.  
  86. ; ask if you want to dearchive the html files
  87. (if
  88.     (askbool
  89.     (prompt "Do you want to dearchive the sample html files?")
  90.     (default 0)
  91.     (help @bool-help)
  92.     )
  93.     (
  94.     (set lhacommand "lha x ")
  95.     (set lhacommand (cat lhacommand (tackon @apache-src-dest "sample_html.lha") ) )
  96.     (set lhacommand (cat lhacommand " apache:") )
  97.     (run lhacommand (prompt "Unarchiving files") )
  98.     )
  99.     (debug "Didn't want to unarchive files")
  100. )
  101.  
  102. ; get rid of this
  103. (delete (tackon @apache-src-dest "sample_html.lha") )
  104.  
  105. (set apache-install "assign apache: ")
  106. (set apache-install (cat apache-install @apache-src-dest) )
  107.  
  108. (if ( = (exists "bin:" (noreq) )  2 )
  109.     (
  110.     (if (= (expandpath "bin:") @source-bin-dir)
  111.         (debug "installing bin into same directory")
  112.         (
  113.         (copyfiles
  114.             (prompt "Copying bin to bin:")
  115.             (source "bin")
  116.             (dest "bin:")
  117.             (confirm)
  118.             (help @copyfiles-help)
  119.             (all)
  120.         )
  121.         (delete @source-bin-dir)
  122.         )
  123.     )
  124.     )
  125.     (set apache-install (cat apache-install "assign bin: apache:bin\n") )
  126.     (set apache-install (cat apache-install "path bin: add\n") )
  127. )
  128.  
  129. (debug "apache-install is" apache-install)
  130.  
  131. (startup "apache" apache-install
  132.     (prompt ("%s%s"
  133.         "Add the following lines to s:user-startup\n"
  134.         apache-install
  135.         )
  136.     )
  137.     (help @startup-help)
  138.     (command apache-install)
  139. )
  140.  
  141. ; add user http
  142. (if
  143.     (askbool
  144.     (prompt "Add user http to Inet:db/passwd?")
  145.     (default 1)
  146.     (help @bool-help)
  147.     )
  148.     (
  149.     (textfile
  150.         (dest "t:passwd")
  151.         (include "Inet:db/passwd")
  152.         (append "http|*|1001|1001||sys:|cli")
  153.     )
  154.     (copyfiles
  155.         (source "t:passwd")
  156.         (dest "Inet:db")
  157.     )
  158.     (delete "t:passwd")
  159.     )
  160.     (debug "Didn't want to add user")
  161. )
  162.  
  163.  
  164. ; add group http
  165. (if
  166.     (askbool
  167.     (prompt "Add group http to Inet:db/group?" )
  168.     (default 1)
  169.     (help @bool-help)
  170.     )
  171.     (
  172.     (textfile
  173.         (dest "t:group")
  174.         (include "Inet:db/group")
  175.         (append "http|*|1001|http")
  176.     )
  177.     (copyfiles
  178.         (source "t:group")
  179.         (dest "Inet:db")
  180.     )
  181.     (delete "t:group")
  182.     )
  183.     (debug "Didn't want to add group")
  184. )
  185.  
  186.  
  187. ; add services line
  188. (if
  189.     (askbool
  190.     (prompt "Add the following line to inet:db/services\n"
  191.         "http  80/tcp ; World Wide Web"
  192.     )
  193.     (default 1)
  194.     (help @bool-help)
  195.     )
  196.     (
  197.     (textfile
  198.         (dest "t:services")
  199.         (include "Inet:db/services")
  200.         (append "http   80/tcp  ;World Wide Web")
  201.     )
  202.     (copyfiles
  203.         (source "t:services")
  204.         (dest "Inet:db")
  205.     )
  206.     (delete "t:service")
  207.     )
  208.     (debug "Didn't want to add service")
  209. )
  210.  
  211. (message
  212.     "Congratulations, Apache is now installed."
  213.     "All documentation can be found at http://www.apache.org/  "
  214.     "Since Inet225 and AmiTCP differ in inetd.conf lines add the"
  215.     "following for Inet225:\n"
  216.     "http  stream  tcp  nowait  apache:httpd\n"
  217.     "or for AmiTCP:\n"
  218.     "http  stream  tcp  nowait  root  apache:httpd\n"
  219.     "To get started right away you need to send break the inetd process"
  220.     "with signal f - ie. \"break <inetd_process_number> f\"\n"
  221.     "Enjoy!"
  222. )
  223.  
  224. (exit (quiet) )
  225.